package SixWeek;

import java.util.Arrays;
import java.util.Scanner;

class ArrayUtils{
	public static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	static PairResult findMinMax(Double[] values){
		PairResult pr=new PairResult();
		Arrays.sort(values);
		pr.min=values[0];
		pr.max=values[values.length-1];
		return pr;
		
	}
}
public class fivefour{
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		int n=input.nextInt();
		Double[] values=new Double[n];
		for (int i = 0; i < values.length; i++) {
			values[i]=new Double(input.nextDouble());
		}
		System.out.println(ArrayUtils.findMinMax(values));
		System.out.println(ArrayUtils.PairResult.class);
	}
	
}
